<!-- 表单弹窗 -->
<form id="club-form" lay-filter="club-form" class="layui-form model-form" style="overflow:auto; height:500px;width:90%;">
    <input name="id" type="hidden"/>
    				    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">标题</label>-->
        <!--<div class="layui-input-block">-->
            <!--<input name="title" placeholder="请输入标题" type="text" class="layui-input" maxlength="20"  id="title"-->
                   <!--lay-verify="required" required/>-->
        <!--</div>-->
    <!--</div>-->
 		    <div class="layui-form-item">
        <label class="layui-form-label">博客内容</label>
        <div class="layui-input-block">
            <input name="content" placeholder="请输入博客内容" type="text" class="layui-input" maxlength="20"  id="content"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">图片</label>
        <!--<div class="layui-input-block">-->
            <!--<input name="images" placeholder="请输入图片，多张，用半角分号隔开" type="text" class="layui-input" maxlength="20"  id="images"-->
                   <!--lay-verify="required" required/>-->
        <!--</div>-->
                <div id="imgs"></div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">创建人</label>
        <div class="layui-input-block">
            <input name="memberId" placeholder="请输入创建人，会员ID" type="hidden" class="layui-input" maxlength="20"  id="memberId"
                   lay-verify="required" required/>
            <input name="memberName" placeholder="请输入创建人，会员ID" type="text" class="layui-input" maxlength="20"  id="memberName"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-block">
            <input name="createDate" placeholder="请输入创建时间" type="text" class="layui-input" maxlength="20"  id="createDate"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">浏览次数</label>
        <div class="layui-input-block">
            <input name="viewTimes" placeholder="请输入浏览次数" type="text" class="layui-input" maxlength="20"  id="viewTimes"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">分享次数</label>
        <div class="layui-input-block">
            <input name="shareTimes" placeholder="请输入分享次数" type="text" class="layui-input" maxlength="20"  id="shareTimes"
                   lay-verify="required" readonly required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">评价次数</label>
        <div class="layui-input-block">
            <input name="evaluationTimes" placeholder="请输入评价次数" type="text" class="layui-input" maxlength="20"  id="evaluationTimes"
                   lay-verify="required" readonly required/>
        </div>
    </div>
     <div class="layui-form-item model-form-footer">
        <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
        <!--<button class="layui-btn" lay-filter="user-form-submit" lay-submit>保存</button>-->
    </div>
</form>

<script>
    layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
        var layer = layui.layer;
        var admin = layui.admin;
        var form = layui.form;
        var formSelects = layui.formSelects;
        var strImages="";
        var club = admin.getTempData('t_club');
           if (club.method=="update"){

               if(club.images){
                   club.images.split(";").forEach(function(item,index){
                       strImages = strImages+'<image src="'+item+'" style="width:50px; " />'
                           })  }
                           // club.strImages=strImages;
               $("#imgs").html(strImages);
        	form.val('club-form', club);
            form.render();
        }
        // 表单提交事件
        form.on('submit(user-form-submit)', function (data) {
             layer.load(2);
            
            admin.req('cms/club/'+club.method, JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
                if (data.code == 0) {
                    layer.msg(data.msg, {icon: 1, time: 500});
                    admin.finishPopupCenter();
                } else {
                    layer.msg(data.msg, {icon: 2, time: 500});
                }
            }, "post");  
            return false;
        });
    });
</script>
